package com.jzo2o.customer.controller.agency;


import com.jzo2o.customer.mapper.BankAccountMapper;
import com.jzo2o.customer.model.dto.request.BankAccountUpsertReqDTO;
import com.jzo2o.customer.model.dto.response.BankAccountResDTO;
import com.jzo2o.customer.service.IBankAccountService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.time.Period;

/**
 * <p>
 * 银行账户 前端控制器
 * </p>
 *
 * @author jianghaijun
 * @since 2025-10-23
 */
@Api("机构端 - 银行账户相关接口")
@RestController("agencyBankAccount")
@RequestMapping("/agency/bank-account")
public class BankAccountController {

    @Resource
    private IBankAccountService bankAccountService;

    @ApiOperation("新增或更新银行账号信息接口")
    @PostMapping
    public void addOrUpdateBankAccount(BankAccountUpsertReqDTO bankAccountUpsertReqDTO) {
        bankAccountService.addOrUpdateBankAccount(bankAccountUpsertReqDTO);
    }

    @ApiOperation("获取当前用户银行账号")
    @GetMapping("/currentUserBankAccount")
    public BankAccountResDTO currentUserBankAccount() {
        return bankAccountService.currentUserBankAccount();
    }

}
